package com.spddr.pmos.cxf;

import java.util.Collection;

import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

import com.spddr.pmos.jpa.Plant;
import com.spddr.pmos.jpa.Reservoir;

import cn.seqdata.cxf.repos.JaxrsObjectRepository;

@Path("/reservoir")
public interface JaxrsReservoir extends JaxrsObjectRepository<Reservoir> {
	@PUT
	@Path("/")
	default <S extends Reservoir> S save(S entity) {
		return getRepository().save(entity);
	}

	@GET
	@Path("/{id}/plants")
	Collection<Plant> plants(@PathParam("id") long reservoir);
}
